package team.lourd.network.system.config;

import org.springframework.beans.factory.ObjectFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;

import java.util.ArrayList;
import java.util.List;

@Configuration
public class RepositoryConfiguration extends RepositoryRestMvcConfiguration {
//    @Bean
//    NEModelEventHandler accountEventHandler() {
//        return new NEModelEventHandler();
//    }

    public RepositoryConfiguration(ApplicationContext context, ObjectFactory<ConversionService> conversionService)
    {
        super(context, conversionService);
    }

    @Override
    protected List<HandlerMethodArgumentResolver> defaultMethodArgumentResolvers()
    {
        List<HandlerMethodArgumentResolver> resolvers =
                new ArrayList<>(super.defaultMethodArgumentResolvers());
        resolvers.add(new JsonPathArgumentResolver());
        return resolvers;
    }
}